package org.apache.dubbo.demo.consumer.ndcg;

import org.junit.Test;

public class Similarity {

  @Test
  public void testSimilarity() {
    System.out.println((molecule(2) + molecule(4)) / denominator(2, 4));
  }

  private double molecule(int i) {
    return 1 / Math.log(1 + i);
  }

  private double denominator(int m, int n) {
    return Math.sqrt(m * n);
  }
}
